home *** CD-ROM | disk | FTP | other *** search
- /* copyright (c) 1982 by the Toolsmith */
-
- struct linked_list {
- struct linked_list *link;
- };
-
- /* reverse - invert order of a linked list */
-
- struct linked_list *reverse(this)
- register struct linked_list *this;
- {
- register struct linked_list *next, *previous;
-
- for (previous = NULL; this != NULL; previous = this, this = next) {
- next = this->link;
- this->link = previous;
- }
-
- return previous;
- }
-
- /* insert - add an "n" byte element to fron of "list" */
-
- struct linked_list *insert(n, list)
- unsigned n;
- struct linked_list *list;
- {
- extern char *alloc();
-
- return (struct linked_list *) alloc(n, list);
- }
-